package com;

import com.listener.VCListener;

import javax.swing.*;
import java.awt.*;

/**
 * Author：hanll
 * ClassName：VideoCapture
 * Date：2022/11/1 10:56
 * Version：1.0
 * Description：
 */
public class VideoCapture extends JFrame {

    private VCListener listener = new VCListener();

    public void init() {
        //创建窗体
        setTitle("Video Capture");
        setSize(800, 500);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setLayout(new FlowLayout());
        //添加按钮
        String [] btn = {"启动", "关闭", "拍照"};
        for (String str : btn) {
            JButton jButton = new JButton(str);
            jButton.setPreferredSize(new Dimension(90, 30));
            jButton.addActionListener(listener);
            add(jButton);
        }
        setVisible(true);
        listener.setVCListener(getGraphics());
    }

    public static void main(String[] args) {
        new VideoCapture().init();
    }
}
